home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 126-150 / disk_146 / dmemacros / commentedmacros / pascal.ifelse.edrc < prev    next >
Text File  |  1992-05-06  |  2KB  |  46 lines

  1. # insert lines for body of text; write marker in text to save location;
  2. # move cursor up one line (may have to add a line if at the top) and move
  3. # to the first character in the line (if there are no characters in the
  4. # line, the cursor moves to the leftmost column;
  5.  
  6. repeat 7 insline `+'  up  firstnb
  7.  
  8.  
  9. # if there is text on this line, insert a line between this line and the
  10. # first line of the template;
  11.  
  12. if c>32 `down insline' down
  13.  
  14.  
  15. # go down to end of template and insure that there is at least one blank
  16. # line between it and any text below it;
  17.  
  18. repeat 7 down firstnb
  19.  
  20. if c>32 insline
  21.  
  22.  
  23. # move back to marker and delete it;
  24.  
  25. repeat 7 up   firstnb del
  26.  
  27.  
  28. # write the body of the template; write 2 markers for later search & replace
  29. # needed to complete comments with test expression; place cursor in position
  30. # to write between parentheses in test expression;
  31.  
  32. `IF () THEN BEGIN'  firstnb down down
  33. `END (* IF + *)'    firstnb down down
  34. `ELSE BEGIN'        firstnb down down
  35. `END; (* ELSE + *)' findstr `) THEN' prev
  36.  
  37.  
  38. # prompt for the test expression (it will printed as a string at the cursor
  39. # location; goto first character of the expression and read text into the
  40. # variable $scanf until you get to a blank; replace the markers in the
  41. # comments with the text in $scanf; move to blank line between first BEGIN-
  42. # END pair and indent for entry of next line of code;
  43.  
  44. escimm (` )    first find `(' right while c<=32 right    scanf %s down    findr `+' $scanf down findr `+' $scanf    up up up up firstnb up tab
  45.  
  46.